package atguigu.chanchulvjisuan;

import java.io.File;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import org.apache.commons.io.FileUtils;

public class CountCCL {

    public static void main(String[] args) {
        File source = new File("d:/产出率.json");
        String s;
        try {
            s = FileUtils.readFileToString(source, Charset.forName("GBK"));
            JSONObject jsonObject = JSONObject.parseObject(s);
            JSONArray jsonArray = jsonObject.getJSONArray("产出率");
            System.out.println(jsonArray.size());

            List<CCL> list = new ArrayList<>();
            for (Object object : jsonArray) {
                JSONObject jObject = (JSONObject) object;
                String equipmentName = jObject.getString("equipmentName");
                Integer theoryTestFormItemCount = jObject.getInteger("theoryTestFormItemCount");
                list.add(new CCL(equipmentName, theoryTestFormItemCount));
            }

        } catch (Exception e) {

        }
    }
}